<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
        <button id="btn1">按钮</button>
        <script>
            var btn1=document.getElementById('btn1').addEventListener("click",function () {
                alert("dom2级事件处理程序");

            })

        </script>
</body>
</html>